package com.felix.dao.impl;

import com.felix.bean.Carshare;
import com.felix.bean.Favor;
import com.felix.bean.Relation;
import com.felix.bean.Temp_mess_list;
import com.felix.bean.User;
import com.felix.bean.Vote;
import com.felix.dao.InsertDao;
import com.g3net.database.DataBase;
import com.g3net.database.DataBaseFactory;
import com.g3net.database.DbException;

public class InsertDaoImpl implements InsertDao {

	public int register(User u) throws DbException {
		DataBase db= DataBaseFactory.getDataBase();
		
		return db.excuteInsertClass(u);
	}

	public int AddCarShare(Carshare csh) throws DbException {
		DataBase db= DataBaseFactory.getDataBase();
		return db.excuteInsertClass(csh);
	}

	public int AddFavor(Favor f) throws DbException {
		DataBase db= DataBaseFactory.getDataBase();
		return db.excuteInsertClass(f);
	}

	public int addTempList(Temp_mess_list temp) throws DbException {
		DataBase db= DataBaseFactory.getDataBase();
		return db.excuteInsertClass(temp);
	}

	public int addRelation(Relation rela) throws DbException {
		// TODO Auto-generated method stub
		DataBase db= DataBaseFactory.getDataBase();
		return db.excuteInsertClass(rela);
	}

	public int addVote(Vote v) throws DbException {
		DataBase db= DataBaseFactory.getDataBase();
		
		return db.excuteInsertClass(v);
	}

}
